# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-pytest-docker-tools
#_pkgreal is used by apkbuild-pypi to find modules at PyPI
_pkgreal=pytest-docker-tools
pkgver=3.1.3
pkgrel=0
pkgdesc="Opionated helpers for creating py.test fixtures for Docker integration and smoke testing environments"
url="https://github.com/Jc2k/pytest-docker-tools"
arch="noarch"
license="Apache-2.0"
depends="
	py3-docker-py
	py3-pytest
"
checkdepends="
	py3-pytest-cov
"
makedepends="
	poetry
	py3-setuptools
	py3-gpep517
	py3-wheel
	docker
"
options="!check" # requires docker
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/Jc2k/pytest-docker-tools/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer "$builddir"/.dist/*.whl
	.testenv/bin/python3 -m pytest -v
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
9f99fe30ad98302bac295d63e145de488a3a7cb60a242101ccfdc41eecf274e831c0c54eb7c11f3f38e55ed4cb6b0db217b38e8fbf7f2a2f9f9edddbcfe2ba90  py3-pytest-docker-tools-3.1.3.tar.gz
"
